<template>
	<view class="">
		<view class="image">
			<image @longpress="toSave" :src="info.img" mode="widthFix" style="width: 100%;"></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info: ""
			}
		},
		onLoad(option) {
			var that = this;
			uni.showLoading({
				title: '海报加载中~'
			})
			that.$axios('Shares/main', "POST", 'commission', {}).then(res => {
				uni.hideLoading()
				if (res.data.code == 200) {
					that.info = res.data.data
				}else{
					uni.showModal({
						title:'温馨提示',
						content:res.data.data
					})
				}
			})
		},
		methods: {
			// 长按保存图片
			async toSave() {
				const [err, res] = await uni.showModal({
					title: '图片保存',
					content: '确定要保存图片吗',
				})
				if (res.confirm) {
					this.saveImg(this.info.img)
				}
			}
		}
	}
</script>

<style lang="scss">
	page {
		padding-bottom: 180rpx;
	}
	.image {
		font-size: 0;
		height: 100%;
	}
</style>